package com.winning.jsyd.entity.describe;

import com.winning.jsyd.entity.business.*;

import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.util.List;

/**
 * 请求数据集合
 *
 * @author z_dd@winning.com.cn
 * @date 2019/5/5 17:44
 */
@XmlRootElement(name = "dataList")
public class DataList<T> implements Serializable {

    private String type;

    private Long size;

    private List<T> data;

    /**
     * Constructs an empty list with an initial capacity of ten.
     */
    public DataList(String type, Long size) {
        this.type = type;
        this.size = size;
    }

    public DataList(String type, Long size, List<T> data) {
        this.type = type;
        this.size = size;
        this.data = data;
    }

    /**
     * Constructs an empty list with an initial capacity of ten.
     */
    public DataList() {
    }

    @XmlAttribute(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @XmlElementRefs({
            @XmlElementRef(type = HaPersonInfoEntity.class),    //居民基本信息
            @XmlElementRef(type = DmChronicBasicInfo.class),    //病人基本信息
            @XmlElementRef(type = DmHighbloodReport.class),     //高血压报告卡
            @XmlElementRef(type = DmDiabetesReport.class),      //糖尿病报告卡
            @XmlElementRef(type = DmChronicVisitInfo.class),    //病人随访信息
            @XmlElementRef(type = DmHighbloodVisit.class),      //高血压访视
            @XmlElementRef(type = DmDiabetesVisit.class),       //糖尿病访视
            @XmlElementRef(type = MssRcptMaster.class),       //门诊收费记录
            @XmlElementRef(type = MssRcptBill.class),       //门诊收费项目
            @XmlElementRef(type = MssOutVisit.class),       //门诊病历病人信息
            @XmlElementRef(type = MssOutDiagnosis.class),       //门诊病历诊断信息
            @XmlElementRef(type = MssPrescMaster.class),       //门诊处方主记录
            @XmlElementRef(type = MssPrescDetail.class),       //门诊处方明细记录
            @XmlElementRef(type = MssExamMaster.class),       //检查主记录
            @XmlElementRef(type = MssExamDetail.class),       //检查明细记录
            @XmlElementRef(type = MssTestMaster.class),       //检验主记录
            @XmlElementRef(type = MssTestDetail.class),       //检验明细记录
            @XmlElementRef(type = MssPatsBillDetail.class),   //住院病人费用明细
            @XmlElementRef(type = MssPatsSettleMaster.class), //病人结算主记录和明细信息
            @XmlElementRef(type = MssInOrder.class),          //门诊医嘱记录
            @XmlElementRef(type = HMssPrescMaster.class),          //住院处方主记录
            @XmlElementRef(type = HMssPrescDetail.class),          //住院处方明细记录
            @XmlElementRef(type = MssResidentAdmin.class),          //入院记录
            @XmlElementRef(type = MssOperationApply.class),          //手术申请
            @XmlElementRef(type = MssOperationRecord.class),          //手术记录
            @XmlElementRef(type = MssDischarge.class),          //出院记录
    })
    public List<T> getData() {
        return data;
    }

    @XmlAttribute(name = "size")
    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
